package com.yfbao.horizon.model;

import org.springframework.data.redis.connection.Message;
import org.springframework.data.redis.connection.MessageListener;

public class MyMessageListener implements MessageListener {

    @Override
    public void onMessage(Message message, byte[] pattern) {
        byte[] body = message.getBody();
        byte[] channel = message.getChannel();

        // 处理接收到的消息
        String receivedMessage = new String(body);
        String channelName = new String(channel);

        System.out.println("Received message: " + receivedMessage + " from channel: " + channelName);
    }
}